<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload = function () {
            const aObj = document.querySelector("a");

            aObj.addEventListener("click", function () {
                console.log("a处于事件的捕获阶段");
            }, true);

            aObj.addEventListener("click", function () {
                console.log("a处于事件的冒泡阶段");
            }, false);

            document.body.addEventListener("click", function () {
                console.log("body处于事件的捕获阶段");
            }, true);

            document.body.addEventListener("click", function () {
                console.log("body处于事件的冒泡阶段");
            }, false);

            document.documentElement.addEventListener("click", function () {
                console.log("html处于事件的捕获阶段");
            }, true);

            document.documentElement.addEventListener("click", function () {
                console.log("html处于事件的冒泡阶段");
            }, false);

            document.addEventListener("click", function () {
                console.log("document处于事件的捕获阶段");
            }, true);

            document.addEventListener("click", function () {
                console.log("document处于事件的冒泡阶段");
            }, false);
        }

    </script>
</head>

<body>
    <a href="#">捕获和冒泡同时存在的时候</a>
</body>

</html>